<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page import="java.sql.ResultSet" %>
<%@ page import="java.sql.SQLException" %>
<%@ page import="java.sql.Statement" %>
<%@ page import="java.sql.Connection" %>
<%@ page import="java.sql.DriverManager" %>
<%@ page language="java" import="java.lang.*" %>
<%@ page import = "java.sql.SQLException" %>
<%@ page import = "com.seniorproject.aims.*" %>
<%@ page import = "java.util.List" %>
<%@page  import="java.util.ArrayList"%>
<%@ page import = "java.util.Properties" %>
<%@ page import = "javax.servlet.ServletContext" %>
<%@ page import = "java.io.File" %>
<%@ page import = "java.io.InputStream" %>
<%@ page import = "java.util.Date" %>
<%@ page import = "java.text.SimpleDateFormat" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Student Detail</title>
<link rel="stylesheet" href="css/stylev2.css" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery-2.1.1.min.js"></script>
<script src="js/FileSaver.js"></script>
<script src="js/jquery-student-detail-wordexport.js"></script>

<script type="text/javascript" src="js/jspdf.js"></script>
<script type="text/javascript" src="js/jspdf/jspdf.plugin.standard_fonts_metrics.js"></script> 
<script type="text/javascript" src="js/jspdf/jspdf.plugin.split_text_to_size.js"></script>               
<script type="text/javascript" src="js/jspdf/jspdf.plugin.from_html.js"></script>
<script type="text/javascript" src="js/jspdf/jspdf.plugin.addimage.js"></script>
<script type="text/javascript" src="js/jspdf/jspdf.debug.js"></script>

<style type="text/css">
	a {
      text-decoration:none;
   }
   
   .redgrad {
	    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f4160b', endColorstr='#cd1108');
	    background: -webkit-gradient(linear, left top, left bottom, from(#f4160b), to(#cd1108));
	    background: -moz-linear-gradient(top, #f4160b, #cd1108);
	    color: white;
	}
	.redgrad:hover {
	    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f4160b', endColorstr='#a40a02');
	    background: -webkit-gradient(linear, left top, left bottom, from(#f4160b), to(#a40a02));
	    background: -moz-linear-gradient(top, #f4160b, #a40a02);
	    cursor: pointer;
	    color: white;
	}
</style>



<script type="text/javascript">

jQuery(document).ready(function($) {
	 
	 $("#word_export").click(function(event) {

			 try{
			 	$("#export-content").wordExport();
	
			 }catch(x){
				 alert(x);
			 }
	

		 });


});
 
	function delete_button(index, name) {
		
		if (confirm("คุณต้องการจะลบข้อมูล " + name) == true) {
			/* AJAX */
			var xmlhttp;
			
			if(window.XMLHttpRequest) {
				// code for IE7+, Firefox, Chrome, Opera, Safari
				xmlhttp = new XMLHttpRequest();
			}
			else {
				// code for IE6, IE5
				xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			}
			
			xmlhttp.onreadystatechange = function() {
				if(xmlhttp.readyState == 4 && xmlhttp.status == 200) {
					var result = xmlhttp.responseText.trim();
					
					if(result == "success") {
						alert("สำเร็จ");
						location.replace("student_search.jsp");
					}
					else {
						alert("ไม่สามารถลบข้อมูลได้ค่ะ");
					}
				}
			}
			
			xmlhttp.open("POST", "student_delete.jsp?index="+index, true);
			xmlhttp.send();
	    } else { }
	}
	
 

function show_student_file(){

		var stu_id = document.getElementById("student_id").value;
		var form = document.createElement("form");
 	    form.setAttribute("method", "post");
 	    form.setAttribute("action", "student_file_all.jsp");
 	    var hiddenField = document.createElement("input");
 	    hiddenField.setAttribute("type", "hidden");
        hiddenField.setAttribute("name", "student_id");
        hiddenField.setAttribute("id","student_id");
        hiddenField.setAttribute("value", stu_id);
        form.appendChild(hiddenField);
         
        document.body.appendChild(form);
        form.submit();
 }


</script>
<style type="text/css">

.silvergrad:hover {
 
    cursor: pointer;
   
}


</style>

</head>
<body>

<%
	// get session
	String strUser = String.valueOf(session.getAttribute("sUser"));
	HttpSession htp_session = request.getSession();
	

	// check session
	if (htp_session == null || htp_session.getAttribute("sUser") == null) {
	    // Forward the control to login.jsp if authentication fails or session expires
	    request.getRequestDispatcher("/login.jsp").forward(request,
	        response);
	}
	
	if("admin".equals(htp_session.getAttribute("sUser"))){%>
	<script>alert("This user dont have PERMISSION to access this zone.");</script>
	<meta HTTP-EQUIV="Refresh" CONTENT="0; URL=admin_home.jsp"> 	
	<%}
	
//////////get permission ///////////
	
	String name = String.valueOf(session.getAttribute("name"));
	String surname = String.valueOf(session.getAttribute("surname"));
	String role_name = String.valueOf(session.getAttribute("student_role"));
	
	String department_id = String.valueOf(session.getAttribute("department_id"));

	System.out.println("name : " + name);///////////////////////////////
	System.out.println("department_id : " + department_id);/////////////////////////
	
	
	List<String> system_name = new ArrayList<String>();
	
	Permission permission = new Permission(strUser,name);
	permission.setDepartmentId(department_id);
	permission.setStudentCreate(Boolean.valueOf(String.valueOf(session.getAttribute("student_create"))));
	permission.setStudentDelete(Boolean.valueOf(String.valueOf(session.getAttribute("student_delete"))));
	permission.setStudentRead(Boolean.valueOf(String.valueOf(session.getAttribute("student_read"))));
	permission.setStudentUpdate(Boolean.valueOf(String.valueOf(session.getAttribute("student_update"))));
	
	String permiss = "";
	if(permission.getStudentCreate()) {
		permiss = permiss + "Add";
	}
	if(permission.getStudentUpdate()) {
		if("".equals(permiss)) {
			permiss = permiss + "Edit";
		} else {
			permiss = permiss + " Edit";
		}
	}
	if(permission.getStudentRead()) {
		if("".equals(permiss)) {
			permiss = permiss + "Read";
		} else {
			permiss = permiss + " Read";
		}
	}
	if(permission.getStudentDelete()) {
		if("".equals(permiss)) {
			permiss = permiss + "Delete";
		} else {
			permiss = permiss + " Delete";
		}
	}
	//check permission
	if(!permission.getStudentRead()){%>
		<script>alert("This user dont have PERMISSION to access this zone.");</script>
		<meta HTTP-EQUIV="Refresh" CONTENT="0; URL=student_home.jsp"> 	
	<%}
	
	//set Database Connection
	String hostProps = "";
	String usernameProps  = "";
	String passwordProps  = "";
	
	try {
		//get current path
		ServletContext servletContext = request.getSession().getServletContext();
		
		InputStream input = servletContext.getResourceAsStream("/properties/connectDB.properties");
		Properties props = new Properties();
		
		props.load(input);

		hostProps  = props.getProperty("host");
		usernameProps  = props.getProperty("username");
		passwordProps  = props.getProperty("password");
	} catch (Exception e) { 
		out.println(e);  
	}

	System.out.println("hostProperties : "+hostProps);////////////////try/////////////////
	System.out.println("usernameProperties : "+usernameProps);////////////////try/////////////////
	System.out.println("passwordProperties : "+passwordProps);////////////////try/////////////////
	
	// connect database
	Connection connect = null;		
	try {
		Class.forName("com.mysql.jdbc.Driver");
	
		connect =  DriverManager.getConnection("jdbc:mysql://" + hostProps  + "/AIMS" +
				"?user=" + usernameProps  + "&password=" + passwordProps );
	
		if(connect != null){
			System.out.println("Database Connect Sucesses.");
		} else {
			System.out.println("Database Connect Failed.");	
		}

	} catch (Exception e) {
		out.println(e.getMessage());
		e.printStackTrace();
	}
	
	Date date = new Date();
	int temp_year = date.getYear()+1900;
	int temp_month = date.getMonth()+1;
	
	
	String student_id = request.getParameter("student_id");
	
	if(student_id==null)
	{
		 response.sendRedirect("student_search.jsp");
	}
	
	System.out.println("@ student_detail student_id:"+student_id);
	String entrance_id="";
	String curr_id="";
	String lecturer_id="";
	String index = "";
	
	Student stu = new Student();
	
	
	ResultSet rs = 
			connect.createStatement().executeQuery(" SELECT S.picture, N.title_th ,"+
					" N.name_th, N.surname_th , N.name_en , N.surname_en ,P.personal_id, P.gender,P.marital_status ,"+
				    " P.address , P.phone_number, P.email , P.facebook , S.father_name , S.father_address ,"+
					" S.father_phone ,S.mother_name , S.mother_address , S.mother_phone , S.parent_name,"+
				    " S.parent_address ,S.parent_phone ,S.student_id, S.start_date , S.entrance_id  , S.school ,"+
					" S.gpa , ST.status_name ,D.department_name_th, S.curriculum_id ,P.date_of_birth ,S.lecturer_id, P.index "+
				    " FROM student S, full_name N, department D, status ST, people P "+
				    " WHERE S.index = P.index AND P.full_name_id = N.full_name_id "+
				    " AND S.department_id = D.department_id AND S.status_id = ST.status_id "+
				    " AND S.student_id='"+student_id+"'");
	
	
	while(rs.next())
	{
		String src_path_full = rs.getString("picture");
		if((src_path_full!=null)&&(!("null").equals(src_path_full)))
		{
			String[] src_path_temp = src_path_full.split("/");	
			int length = src_path_temp.length;
			
			String src_path_a = src_path_temp[length-2];
			String src_path_b = src_path_temp[length-1];
			
			String src_path = src_path_a+"/"+src_path_b;
			
			stu.setPicture(src_path);
		
		}else{
			stu.setPicture("upload/default_person_icon.jpg");
			
		}
	
		
		index = rs.getString("index");
		
		
		if(rs.getString("personal_id")!=null&&(!("null").equals(rs.getString("personal_id"))))
		{
			stu.setPersonalId(rs.getString("personal_id"));
			
		}else{
			
			stu.setPersonalId(" ");
		}
		stu.setTitle(rs.getString("title_th"));
		stu.setNameTH(rs.getString("name_th"));
		stu.setSurnameTH(rs.getString("surname_th"));
		if(rs.getString("name_en")!=null&&(!("null").equals(rs.getString("name_en"))))
		{
			stu.setNameEN(rs.getString("name_en"));
		}else{
			stu.setNameEN(" ");
			
		}
		
		if(rs.getString("surname_en")!=null&&(!("null").equals(rs.getString("surname_en"))))
		{
			stu.setSurnameEN(rs.getString("surname_en"));
		}else{
			stu.setSurnameEN(" ");
			
		}
		stu.setBirtgdate(rs.getString("date_of_birth"));
		if(rs.getString("gender").equals("M"))
		{
			stu.setGender("ชาย");
		}else
		{
			stu.setGender("หญิง");
		}
		
		stu.setMaritalStatus(rs.getString("marital_status"));
		stu.setAddress(rs.getString("address"));
		stu.setTelephone(rs.getString("phone_number"));
		stu.setEmail(rs.getString("email"));
		stu.setFacebook(rs.getString("facebook"));
		stu.setFatherName(rs.getString("father_name"));
		stu.setFatherAddress(rs.getString("father_address"));
		stu.setFatherTelephone(rs.getString("father_phone"));
		stu.setMotherName(rs.getString("mother_name"));
		stu.setMotherAddress(rs.getString("mother_address"));
		if(rs.getString("mother_phone")!=null&&(!("null").equals(rs.getString("mother_phone"))))
		{
		
			stu.setMotherTelephone(rs.getString("mother_phone"));
		}else{
			stu.setMotherTelephone(" ");
		}
		stu.setParentName(rs.getString("parent_name"));
		stu.setParentAddress(rs.getString("parent_address"));
		stu.setParentTelephone(rs.getString("parent_phone"));
		stu.setStudentId(rs.getString("student_id"));
		
		Date start_date = new SimpleDateFormat("yyyy-MM-dd").parse(rs.getString("start_date"));
		int start_date_num = start_date.getYear()+1900;
		String year_str ;
	
	
		if(temp_month<6)
		{
			
			year_str =(temp_year-start_date_num) + "";
			
		}else{
		
			year_str =(temp_year-start_date_num+1)+"";
		}
		
		
		
		stu.setYear(year_str);
		stu.setSchool(rs.getString("school"));
		stu.setGpa(rs.getString("gpa"));
		stu.setStatus(rs.getString("status_name"));
		stu.setDepartment(rs.getString("department_name_th"));
		
	    entrance_id = rs.getString("entrance_id");
		curr_id = rs.getString("curriculum_id");
		lecturer_id = rs.getString("lecturer_id");
		
		
	}		
	ResultSet rs_ent = connect.createStatement().executeQuery(" SELECT entrance_name " +
															  " FROM entrance " +
															  " WHERE entrance_id='"+entrance_id+"'");
		while(rs_ent.next()){
			stu.setEntrance(rs_ent.getString("entrance_name"));
		}
		
	ResultSet rs_curr =  connect.createStatement().executeQuery(" SELECT curriculum_name_th , degree "+
																" FROM curriculum "+
																" WHERE curriculum_id='"+curr_id+"'");
		while(rs_curr.next()){
			stu.setCurriculumName(rs_curr.getString("curriculum_name_th"));
			stu.setDegree(rs_curr.getString("degree"));
		}
		
	ResultSet rs_lec = connect.createStatement().executeQuery(" SELECT *" +
															  " FROM lecturer L , full_name N "+
															  " WHERE L.index = N.index "+		
															  " AND L.index='"+lecturer_id+"'");
		while(rs_lec.next()){
			stu.setLecturer(rs_lec.getString("name_th")+" "+rs_lec.getString("surname_th"));
		}
			
		connect.close();	

%>


<div id="page-wrap">
		<div id="inside">
		
			<table border="1">
				<tr style="font-size:24px">
					<td width="600" height="100" style= "background-color: #273b80;border: 0px ;padding: 0px; 0px;" >
						<div id="header_banner-2"></div>
					</td>	
					
					<td width="680" height="100" style= "background-color: #273b80;border: 0px;padding: 0px; 0px;" >
						<p align="right"><label><font size="4" color="#ffffff">username : <%=strUser%>&nbsp;&nbsp;</font></label></p>
						<a href="logout.jsp"><p align="right"><label style="cursor: pointer;"><font size="3" color="#ffffff">log out &nbsp;</font></label></p></a>
					</td>
				</tr>
			</table>	

				
					<div id="main-content-ac">
					
					<br><br><br>	
					
					
					 <div style="padding-left: 980px;">
						<table border ="0" style="border: 0; border-collapse:collapse;">
							<tr style="border: 0; border-collapse:collapse;">
								<td id="file" class="silvergrad" style="border: 0; border-collapse:collapse;" onclick="show_student_file()">
									<span title="ไฟล์เอกสารส่วนตัว">
										<img id="file_icon" src="image/file_icon.png" style="width:45px; height:38px;">
									</span>
								</td>
								
								<td style="border: 0; border-collapse:collapse; width:20px "></td>	
								
								<td  id="word_export" class="silvergrad" style="border: 0; border-collapse:collapse;">
									<span title="Export as Microsoft Word">
										<img id="word_export_icon" src="image/doc_export_icon.png" style="width:45px; height:38px;">
									</span>
								</td>
								
								<td style="border: 0; border-collapse:collapse; width:20px "></td>			
							</tr>					
						</table>
						
				
	
					 </div>
					 	</br>
		
						<div id="export-content">
							<center>
							
							
								<table id="detail_table" width="1000" border="1">
						        	<tr style="font-size:24px" >
						        		<td  width="50" height="50" rowspan="5" style="text-align: center;">
											  <% 
											  
											  	System.out.println("PICTURE:"+stu.getPicture());
												if(stu.getPicture()==null)
												{
														System.out.println(" PICTURE NULL");
											  %>
													 
											 			<img id="student_image" src="upload/default_person_icon.jpg" style="width:130px;height:160px;	">
											  <% 													
												}
												else{
													System.out.println(" PICTURE NOT NULL");
													
											   %>					
														 <img id="student_image" src="<%=stu.getPicture() %>" style="width:130px;height:160px;">
											   <%
												}
											  
											  %>					        		
						        		
						        	
						        		</td>
						             	<td  width="500" >
						                	<font size="5"><strong>เลขประจำตัวประชาชน</strong></font>
						                </td>
						                <td width="400" height="50">
						                	<%=stu.getPersonalId() %>
						                </td>
						            </tr>
						                
						                
									<tr style="font-size:24px">
						                <td height="50">
						                	<font size="5"><strong>รหัสนักศึกษา</strong></font>
						                </td>
						                <td height="50">
						                	<%=stu.getStudentId() %>
						                	<input type="hidden" id="student_id" value="<%=stu.getStudentId() %>">
						                </td>
						            </tr>
						                
									<tr style="font-size:24px">
						                <td height="50">
						                	<font size="5"><strong>คำนำหน้า</strong></font>
						                </td>
						                <td height="50">
						                	<%=stu.getTitle() %>
						                </td>
						            </tr>
						                 
						            <tr style="font-size:24px">
						                <td height="50">
						                	<font size="5"><strong>ชื่อ</strong></font>
						                </td>
						                <td height="50">
						                	<%=stu.getNameTH() %>								          		
						                </td>
						            </tr>
						            
						             <tr style="font-size:24px">
						                <td height="50">
						                	<font size="5"><strong>ชื่อ(ภาษาอังกฤษ)</strong></font>
						                </td>
						                <td height="50">
						                	<%=stu.getNameEN() %>								          		
						                </td>
						            </tr>
						            
						            <tr style="font-size:24px">
						            	<td  width="400" height="50"></td>
						                <td height="50">
						                	<font size="5"><strong>นามสกุล</strong></font>
						                </td>
						                <td height="50">
						                	<%=stu.getSurnameTH() %>							          	
						                </td>
						            </tr>
						            
						              <tr style="font-size:24px">
						            	<td  width="400" height="50"></td>
						                <td height="50">
						                	<font size="5"><strong>นามสกุล(ภาษาอังกฤษ)</strong></font>
						                </td>
						                <td height="50">
						                	<%=stu.getSurnameEN() %>							          	
						                </td>
						            </tr>
						            
									<tr style="font-size:24px">
										<td  width="400" height="50"></td>
						                <td height="50">
						                	<font size="5"><strong>เพศ</strong></font>
						                </td>
						                <td height="50">
						                	<%=stu.getGender() %>
						                </td>
						            </tr>
						                
						            <tr style="font-size:24px">
						            	<td  width="400" height="50"></td>
						                <td height="50">
						                	<font size="5"><strong>วันเกิด (ว/ด/ป)</strong></font>
						                </td>
						                <td height="50">
						                	<%=stu.getBirtgdate() %>
						                </td>
						            </tr>
						                	
						            <tr style="font-size:24px">
						            	<td  width="400" height="50"></td>
						                <td height="50">
											<font size="5"><strong>ที่อยู่</strong></font>
						                </td>
						                <td height="50">
						                
						                	<textarea style="font-size:24px" readOnly> <%=stu.getAddress() %> </textarea>
						             		
						                </td>
						           </tr>
						                
									<tr style="font-size:24px">
										<td  width="400" height="50"></td>
						                <td height="50">
						                	<font size="5"><strong>เบอร์โทรศัพท์</strong></font>
						                </td>
						                <td height="50">
						                	<%=stu.getTelephone() %>
						                </td>
						            </tr>
						
									<tr style="font-size:24px">
										<td  width="400" height="50"></td>
						                <td height="50">
											<font size="5"><strong>E-mail</strong></font>
						                </td>
						                <td height="50">
						              	  <%=stu.getEmail() %>
						                </td>
						             </tr>
						
									<tr style="font-size:24px">
										<td  width="400" height="50"></td>
						                <td height="50">
											<font size="5"><strong>Facebook</strong></font>
						                </td>
						                <td height="50">
						                	<%=stu.getFacebook() %>
						                </td>
						            </tr>
						
									
						              
						            <tr style="font-size:24px">
						            	<td  width="400" height="50"></td>
						                <td height="50"><font size="5"><strong>ชื่อบิดา</strong></font>
						                </td>
						                <td height="50">
						                	<%=stu.getFatherName() %>
						                </td>
						            </tr>
						
									<tr style="font-size:24px">
										<td  width="400" height="50"></td>
						                <td height="50">
						                	<font size="5"><strong>ที่อยู่บิดา</strong></font>
						                </td>
						                <td height="50">
						                	<textarea style="font-size:24px" readOnly> <%=stu.getFatherAddress() %> </textarea>
						              </td>
						            </tr>
						
									<tr style="font-size:24px">
										<td  width="400" height="50"></td>
						                <td height="50">
						                	<font size="5"><strong>เบอร์โทรศัพท์บิดา</strong></font>
						                </td>
						                <td height="50">
						                	<%=stu.getFatherTelephone() %>
						                </td>
						            </tr>
						            
						            <tr style="font-size:24px">
						           	    <td  width="400" height="50"></td>
						                <td height="50"><font size="5"><strong>ชื่อมารดา</strong></font>
						                </td>
						                <td height="50">
						                	<%=stu.getMotherName() %>
						                </td>
						            </tr>
						
									<tr style="font-size:24px">
									    <td  width="400" height="50"></td>
						                <td height="50">
						                	<font size="5"><strong>ที่อยู่มารดา</strong></font>
						                </td>
						                <td height="50">
						                		<textarea style="font-size:24px" readOnly> <%=stu.getMotherAddress() %> </textarea>
						              </td>
						            </tr>
						
									<tr style="font-size:24px">
										<td  width="400" height="50"></td>
						                <td height="50">
						                	<font size="5"><strong>เบอร์โทรศัพท์มารดา</strong></font>
						                </td>
						                <td height="50">
						              		<%= stu.getMotherTelephone() %>
						                </td>
						            </tr>
						              
						          <tr style="font-size:24px">
						          		<td  width="400" height="50"></td>
						                <td height="50"><font size="5"><strong>ชื่อผู้ปกครอง</strong></font>
						                </td>
						                <td height="50">
						                		<%=stu.getParentName() %>
						                </td>
						            </tr>
						
									<tr style="font-size:24px">
										<td  width="400" height="50"></td>
						                <td height="50">
						                	<font size="5"><strong>ที่อยู่ผู้ปกครอง</strong></font>
						                </td>
						                <td height="50">
						                	<%=stu.getParentAddress() %>
						              </td>
						            </tr>
						
									<tr style="font-size:24px">
										<td  width="400" height="50"></td>
						                <td height="50">
						                	<font size="5"><strong>เบอร์โทรศัพท์ผู้ปกครอง</strong></font>
						                </td>
						                <td height="50">
						              		<%=stu.getParentTelephone() %>
						                </td>
						            </tr>
						
									<tr style="font-size:24px">
										<td  width="400" height="50"></td>
						                <td height="50">
						                	<font size="5"><strong>ชั้นปี</strong></font>
						                </td>
						                <td height="50">
						                		<%=stu.getYear() %>
						                </td>
						            </tr>
						
									<tr style="font-size:24px">
										<td  width="400" height="50"></td>
						                <td height="50">
						                	<font size="5"><strong>ภาควิชา</strong></font>
						                </td>
						                <td height="50">
						             			<%=stu.getDepartment() %>
						                </td>
						            </tr>
						
									<tr style="font-size:24px">
										<td  width="400" height="50"></td>
						                <td height="50">
						                	<font size="5"><strong>หลักสูตร</strong></font
						                ></td>
						                <td height="50">
						  						<%=stu.getCurriculumName() %>
						                </td>
						            </td>
						
									<tr style="font-size:24px">
										<td  width="400" height="50"></td>
						                <td height="50">
						                	<font size="5"><strong>Entrance</strong></font>
						                </td>
						                <td height="50">
						                	<%=stu.getEntrance() %>
						                </td>
						            </tr>
						
									<tr style="font-size:24px">
										<td  width="400" height="50"></td>
						                <td height="50">
						                	<font size="5"><strong>ระดับการศึกษา</strong></font>
						                </td>
						                <td height="50">
						               		<%=stu.getDegree() %>
						                </td>
						            </tr>
						              
						            <tr style="font-size:24px">
						            	<td  width="200" height="50"></td>
						                <td height="50">
						                	<font size="5"><strong>โรงเรียนเดิม</strong></font>
						                </td>
							             <td height="50">
							             		<%=stu.getSchool() %>
							             </td>
						            </tr>
						            
						            <tr style="font-size:24px">
						            	<td  width="200" height="50"></td>
						                <td height="50">
						                	<font size="5"><strong>GPA (ม.ปลาย)</strong></font>
						                </td>
							             <td height="50">
							             		<%=stu.getGpa() %>
							             </td>
						            </tr>
						
									<tr style="font-size:24px">
										<td  width="200" height="50"></td>
						                <td height="50">
											<font size="5"><strong>สถานะ</strong></font>
						                </td>
						                <td height="50">
						                		<%=stu.getStatus() %>
						                </td>
						            </tr>
						            
						            <tr style="font-size:24px">
						            	<td  width="200" height="50"></td>
						                <td height="50">
						                	<font size="5"><strong>อาจารย์ที่ปรึกษา</strong></font>
						                </td>
						                <td height="50">
						                	<%=stu.getLecturer() %>
						                </td>
						            </tr>
				<%
						if(permission.getStudentDelete()) {
				%>		            
						            <tr style="font-size:24px">
						     			
						     			<td class="redgrad" width="200" height="90" colspan="3" style="text-align: center;" onclick="delete_button('<%= index%>', '<%= stu.getNameTH()+" "+stu.getSurnameTH()%>')">
						     				 ลบ
						     			
						     			</td>
						            </tr>			
				<%
						}
				%>		     		
						     		<tr style="font-size:24px">
						     			
						     			<td width="200" height="90" colspan="3" style="text-align: center;">
						     				 <a href="student_search.jsp"><button  style="height: 50px; width: 100px; font-size:medium;">ย้อนกลับ</button></a>
						     			
						     			</td>
						            </tr>				
								</table>
						</center>
						
						<br><br><br><br><br><br>
					</div>
			
			
			<div style="clear: both;"></div>
				
			<div id="footer"></div>
			
		</div>		
			<div style="clear: both;"></div>
   </div>




</body>
</html>